<%@ page language="java" %>
<%@page import="java.sql.DriverManager"%>
<%@page import="java.sql.PreparedStatement"%>
<%@page import="java.sql.Connection"%>
<%
	String DRV = "org.mariadb.jdbc.Driver";
	String URL = "jdbc:mariadb://localhost:3306/jwj8508?user=jwj8508&password=123456";
	String sql = "delete from boardv4 where bdno=?";
	
	Connection conn = null;
	PreparedStatement pstmt = null;
%>
<%
	String bdno = null;
	bdno = request.getParameter("bdno");
	if (bdno!=null) response.sendRedirect("list.jsp");
%>
<%
	try {
		Class.forName(DRV);
		conn = DriverManager.getConnection(URL);
		pstmt = conn.prepareStatement(sql);
		pstmt.setString(1, bdno);
		pstmt.executeUpdate();

	} catch(Exception e){
		e.printStackTrace();
	} finally {
		if (pstmt!=null)try{pstmt.close();}catch(Exception e){}
		if (conn!=null)try{conn.close();}catch(Exception e){}
	}
%>
<%
	try{response.sendRedirect("list.jsp");}catch(Exception e){}
%>